<template>
	<view class="container">
		<view class="title">反馈</view>
		<view class="form-wrapper">
			<form>
				<textarea  placeholder="请输入反馈内容" v-model="content" maxlength="150"/>
				<button type="primary" @click="storeFeedback">提交</button>
			</form>
		</view>
	</view>
</template>

<script>
import {storeUserFeedback} from "../../service/base.js"
	export default {
		data() {
			return {
                content: ""
			}
		},
		methods: {
            storeFeedback() {
				if(this.content){
					storeUserFeedback({content:this.content}).then(res =>{
						uni.showToast({
							title:"反馈提交成功",
							icon: 'none'
						})	
						var t1 = setInterval(() => {
							console.log("tsw")
						   uni.navigateBack({
						   	delta: 1
						   });
						   clearInterval(t1)
						}, 1000);
					})
				}else{
					uni.showToast({
						title:"反馈内容不能为空",
						icon: 'none'
					})	
				}
			}
		}
	}
</script>

<style>
	.container {
		display: flex;
		flex-direction: column;
		background-color: ghostwhite;
	}
	.title{
		width: 100%;
		height: 60rpx;
		text-align: center;
		font-size: 16pt;
		font-weight: 600;
		border-bottom: 2rpx solid #fff;
	}
	.form-wrapper{
		display: flex;
		justify-content: center;
		width: 100%;
		height: 500rpx;
		background-color: ghostwhite;
		padding-top: 15rpx;
	}
	form{
		/* border: #fff solid 2rpx; */
		width: 90%;
		height: 300rpx;
		padding-top: 70rpx;
	}
	input{
		height: 100rpx;
		line-height: 50rpx;
		margin-top: 20rpx;
		margin-bottom: 40rpx;
		background-color: #fff;
		text-align: center;
		border-radius: 20rpx;
		border-bottom: #717171 solid 2rpx;
	}
</style>
